package malou.car.factory;

public class Factory {
    public static Car getCarInstanceByType(String carTypeName){
        Car instanceOfCarReturned = null;
        if( carTypeName.equals("平天")){
            instanceOfCarReturned=new EntityPingtian();
        }
        else if (carTypeName.equals("齐天")){
            instanceOfCarReturned=new EntityQitian();
        }
        else if (carTypeName.equals("通天")){
            instanceOfCarReturned=new EntityTongtian();
        }
        return instanceOfCarReturned;
    }
}
